/**
 * 游戏存档 和storage一样 存储数据
 */


export default class gameStorage{

    /**
     * 音乐
     * @param t 
     */
    static setMusic(t) {
        cc.sys.localStorage.setItem("music", t)
    }
    static getMusic() {
        var t = cc.sys.localStorage.getItem("music");
        return t = t || 0, Number(t)
    }

    /**
     * 音效
     * @param t 
     */
    static setSound(t) {
        cc.sys.localStorage.setItem("sound", t)
    }
    static getSound() {
        var t = cc.sys.localStorage.getItem("sound");
        return t = t || 0, Number(t)
    }

    /**
     * 离线时间
     */
     static setoffLineTime(){
        let _time = new Date().getTime()
        cc.sys.localStorage.setItem('logintime', _time)
    }
    static getoffLineTime(){
        var t = cc.sys.localStorage.getItem('logintime')
        return t = t||0 ,Number(t)
    }

    static setzhendong(t) {
        cc.sys.localStorage.setItem("zhendong", t)
    }
    static getzhendong() {
        var t = cc.sys.localStorage.getItem("zhendong");
        if(t){
            t = Number(t)
        }else{
            t = 0
            this.setzhendong(t)
        }
        return t
    }

}
